var CodeMirror = function () {
    function a(d, e) {
        function Zb(a) {
            return a >= 0 && a < ub.size
        }
        function _b(a) {
            return v(ub, a)
        }
        function ac(a, b) {
            Lb = true;
            var c = b - a.height;
            for (var d = a; d; d = d.parent) d.height += c
        }
        function bc(a) {
            var b = {
                line: 0,
                ch: 0
            };
            rc(b, {
                line: ub.size - 1,
                ch: _b(ub.size - 1).text.length
            }, hb(a), b, b);
            Fb = true
        }
        function cc() {
            var a = [];
            ub.iter(0, ub.size, function (b) {
                a.push(b.text)
            });
            return a.join("\n")
        }
        function dc(a) {
            function l(a) {
                var b = Md(a, true);
                if (b && !_(b, g)) {
                    if (!wb) pc();
                    g = b;
                    Tc(d, b);
                    Fb = false;
                    var c = Mc();
                    if (b.line >= c.to || b.line < c.from) h = setTimeout(Zd(function () {
                        l(a)
                    }), 150)
                }
            }
            function m(a) {
                clearTimeout(h);
                var b = Md(a);
                if (b) Tc(d, b);
                C(a);
                Ic();
                Fb = true;
                n();
                j()
            }
            Sc(H(a, "shiftKey"));
            for (var b = F(a); b != A; b = b.parentNode) if (b.parentNode == W && b != X) return;
            for (var b = F(a); b != A; b = b.parentNode) if (b.parentNode == db) {
                if (f.onGutterClick) f.onGutterClick($b, fb(db.childNodes, b) + Pb, a);
                return C(a)
            }
            var d = Md(a);
            switch (G(a)) {
            case 3:
                if (L && !c) Nd(a);
                return;
            case 2:
                if (d) Wc(d.line, d.ch, true);
                setTimeout(Ic, 20);
                return
            }
            if (!d) {
                if (F(a) == U) C(a);
                return
            }
            if (!wb) pc();
            var e = +(new Date);
            if (Ab && Ab.time > e - 400 && _(Ab.pos, d)) {
                C(a);
                setTimeout(Ic, 20);
                return dd(d.line)
            } else if (zb && zb.time > e - 400 && _(zb.pos, d)) {
                Ab = {
                    time: e,
                    pos: d
                };
                C(a);
                return cd(d)
            } else {
                zb = {
                    time: e,
                    pos: d
                }
            }
            var g = d,
                h;
            if (f.dragDrop && T && !f.readOnly && !_(xb.from, xb.to) && !ab(d, xb.from) && !ab(xb.to, d)) {
                if (P) kb.draggable = true;

                function i(b) {
                    if (P) kb.draggable = false;
                    Cb = false;
                    j();
                    k();
                    if (Math.abs(a.clientX - b.clientX) + Math.abs(a.clientY - b.clientY) < 10) {
                        C(b);
                        Wc(d.line, d.ch, true);
                        Ic()
                    }
                }
                var j = I(document, "mouseup", Zd(i), true);
                var k = I(U, "drop", Zd(i), true);
                Cb = true;
                if (kb.dragDrop) kb.dragDrop();
                return
            }
            C(a);
            Wc(d.line, d.ch, true);
            var n = I(document, "mousemove", Zd(function (a) {
                clearTimeout(h);
                C(a);
                if (!M && !G(a)) m(a);
                else l(a)
            }), true);
            var j = I(document, "mouseup", Zd(m), true)
        }
        function ec(a) {
            for (var b = F(a); b != A; b = b.parentNode) if (b.parentNode == db) return C(a);
            var c = Md(a);
            if (!c) return;
            Ab = {
                time: +(new Date),
                pos: c
            };
            C(a);
            cd(c)
        }
        function fc(a) {
            if (f.onDragEvent && f.onDragEvent($b, B(a))) return;
            a.preventDefault();
            var b = Md(a, true),
                c = a.dataTransfer.files;
            if (!b || f.readOnly) return;
            if (c && c.length && window.FileReader && window.File) {
                function d(a, c) {
                    var d = new FileReader;
                    d.onload = function () {
                        g[c] = d.result;
                        if (++h == e) {
                            b = Yc(b);
                            Zd(function () {
                                var a = xc(g.join(""), b, b);
                                Tc(b, a)
                            })()
                        }
                    };
                    d.readAsText(a)
                }
                var e = c.length,
                    g = Array(e),
                    h = 0;
                for (var i = 0; i < e; ++i) d(c[i], i)
            } else {
                try {
                    var g = a.dataTransfer.getData("Text");
                    if (g) {
                        $d(function () {
                            var a = xb.from,
                                c = xb.to;
                            Tc(b, b);
                            if (Cb) xc("", a, c);
                            yc(g);
                            Ic()
                        })
                    }
                } catch (a) {}
            }
        }
        function gc(a) {
            var b = Bc();
            a.dataTransfer.setData("Text", b);
            if (L || Q) {
                var c = document.createElement("img");
                c.scr = "";
                a.dataTransfer.setDragImage(c, 0, 0)
            }
        }
        function hc(a, b) {
            if (typeof a == "string") {
                a = h[a];
                if (!a) return false
            }
            var c = yb;
            try {
                if (f.readOnly) Eb = true;
                if (b) yb = null;
                a($b)
            } catch (d) {
                if (d != K) throw d;
                return false
            } finally {
                yb = c;
                Eb = false
            }
            return true
        }
        function ic(a) {
            function h() {
                g = true
            }
            var b = j(f.keyMap),
                c = b.auto;
            clearTimeout(lc);
            if (c && !l(a)) lc = setTimeout(function () {
                if (j(f.keyMap) == b) {
                    f.keyMap = c.call ? c.call(null, $b) : c
                }
            }, 50);
            var d = jb[H(a, "keyCode")],
                e = false;
            if (d == null || a.altGraphKey) return false;
            if (H(a, "altKey")) d = "Alt-" + d;
            if (H(a, "ctrlKey")) d = "Ctrl-" + d;
            if (H(a, "metaKey")) d = "Cmd-" + d;
            var g = false;
            if (H(a, "shiftKey")) {
                e = k("Shift-" + d, f.extraKeys, f.keyMap, function (a) {
                    return hc(a, true)
                }, h) || k(d, f.extraKeys, f.keyMap, function (a) {
                    if (typeof a == "string" && /^go[A-Z]/.test(a)) return hc(a)
                }, h)
            } else {
                e = k(d, f.extraKeys, f.keyMap, hc, h)
            }
            if (g) e = false;
            if (e) {
                C(a);
                Od();
                if (M) {
                    a.oldKeyCode = a.keyCode;
                    a.keyCode = 0
                }
            }
            return e
        }
        function jc(a, b) {
            var c = k("'" + b + "'", f.extraKeys, f.keyMap, function (a) {
                return hc(a, true)
            });
            if (c) {
                C(a);
                Od()
            }
            return c
        }
        function mc(a) {
            if (!wb) pc();
            if (M && a.keyCode == 27) {
                a.returnValue = false
            }
            if (Cc) {
                if (Gc()) Cc = false
            }
            if (f.onKeyEvent && f.onKeyEvent($b, B(a))) return;
            var b = H(a, "keyCode");
            Sc(b == 16 || H(a, "shiftKey"));
            var d = ic(a);
            if (window.opera) {
                kc = d ? b : null;
                if (!d && b == 88 && H(a, c ? "metaKey" : "ctrlKey")) yc("")
            }
        }
        function nc(a) {
            if (Cc) Gc();
            if (f.onKeyEvent && f.onKeyEvent($b, B(a))) return;
            var b = H(a, "keyCode"),
                c = H(a, "charCode");
            if (window.opera && b == kc) {
                kc = null;
                C(a);
                return
            }
            if ((window.opera && (!a.which || a.which < 10) || S) && ic(a)) return;
            var d = String.fromCharCode(c == null ? b : c);
            if (f.electricChars && tb.electricChars && f.smartIndent && !f.readOnly) {
                if (tb.electricChars.indexOf(d) > -1) setTimeout(Zd(function () {
                    fd(xb.to.line, "smart")
                }), 75)
            }
            if (jc(a, d)) return;
            Ec()
        }
        function oc(a) {
            if (f.onKeyEvent && f.onKeyEvent($b, B(a))) return;
            if (H(a, "keyCode") == 16) yb = null
        }
        function pc() {
            if (f.readOnly == "nocursor") return;
            if (!wb) {
                if (f.onFocus) f.onFocus($b);
                wb = true;
                if (A.className.search(/\bCodeMirror-focused\b/) == -1) A.className += " CodeMirror-focused";
                if (!Kb) Hc(true)
            }
            Dc();
            Od()
        }
        function qc() {
            if (wb) {
                if (f.onBlur) f.onBlur($b);
                wb = false;
                if (Sb) Zd(function () {
                    if (Sb) {
                        Sb();
                        Sb = null
                    }
                })();
                A.className = A.className.replace(" CodeMirror-focused", "")
            }
            clearInterval(sb);
            setTimeout(function () {
                if (!wb) yb = null
            }, 150)
        }
        function rc(a, b, c, d, e) {
            if (Eb) return;
            if (Wb) {
                var g = [];
                ub.iter(a.line, b.line + 1, function (a) {
                    g.push(a.text)
                });
                Wb.addChange(a.line, c.length, g);
                while (Wb.done.length > f.undoDepth) Wb.done.shift()
            }
            vc(a, b, c, d, e)
        }
        function sc(a, b) {
            if (!a.length) return;
            var c = a.pop(),
                d = [];
            for (var e = c.length - 1; e >= 0; e -= 1) {
                var f = c[e];
                var g = [],
                    h = f.start + f.added;
                ub.iter(f.start, h, function (a) {
                    g.push(a.text)
                });
                d.push({
                    start: f.start,
                    added: f.old.length,
                    old: g
                });
                var i = Yc({
                    line: f.start + f.old.length - 1,
                    ch: eb(g[g.length - 1], f.old[f.old.length - 1])
                });
                vc({
                    line: f.start,
                    ch: 0
                }, {
                    line: h - 1,
                    ch: _b(h - 1).text.length
                }, f.old, i, i)
            }
            Fb = true;
            b.push(d)
        }
        function tc() {
            sc(Wb.done, Wb.undone)
        }
        function uc() {
            sc(Wb.undone, Wb.done)
        }
        function vc(a, b, c, d, e) {
            function y(a) {
                return a <= Math.min(b.line, b.line + s) ? a : a + s
            }
            if (Eb) return;
            var g = false,
                h = Tb.length;
            if (!f.lineWrapping) ub.iter(a.line, b.line + 1, function (a) {
                if (!a.hidden && a.text.length == h) {
                    g = true;
                    return true
                }
            });
            if (a.line != b.line || c.length > 1) Lb = true;
            var i = b.line - a.line,
                j = _b(a.line),
                k = _b(b.line);
            if (a.ch == 0 && b.ch == 0 && c[c.length - 1] == "") {
                var l = [],
                    m = null;
                if (a.line) {
                    m = _b(a.line - 1);
                    m.fixMarkEnds(k)
                } else k.fixMarkStarts();
                for (var n = 0, o = c.length - 1; n < o; ++n) l.push(r.inheritMarks(c[n], m));
                if (i) ub.remove(a.line, i, Mb);
                if (l.length) ub.insert(a.line, l)
            } else if (j == k) {
                if (c.length == 1) j.replace(a.ch, b.ch, c[0]);
                else {
                    k = j.split(b.ch, c[c.length - 1]);
                    j.replace(a.ch, null, c[0]);
                    j.fixMarkEnds(k);
                    var l = [];
                    for (var n = 1, o = c.length - 1; n < o; ++n) l.push(r.inheritMarks(c[n], j));
                    l.push(k);
                    ub.insert(a.line + 1, l)
                }
            } else if (c.length == 1) {
                j.replace(a.ch, null, c[0]);
                k.replace(null, b.ch, "");
                j.append(k);
                ub.remove(a.line + 1, i, Mb)
            } else {
                var l = [];
                j.replace(a.ch, null, c[0]);
                k.replace(null, b.ch, c[c.length - 1]);
                j.fixMarkEnds(k);
                for (var n = 1, o = c.length - 1; n < o; ++n) l.push(r.inheritMarks(c[n], j));
                if (i > 1) ub.remove(a.line + 1, i - 1, Mb);
                ub.insert(a.line + 1, l)
            }
            if (f.lineWrapping) {
                var p = Math.max(5, U.clientWidth / Jd() - 3);
                ub.iter(a.line, a.line + c.length, function (a) {
                    if (a.hidden) return;
                    var b = Math.ceil(a.text.length / p) || 1;
                    if (b != a.height) ac(a, b)
                })
            } else {
                ub.iter(a.line, a.line + c.length, function (a) {
                    var b = a.text;
                    if (!a.hidden && b.length > h) {
                        Tb = b;
                        h = b.length;
                        Ub = null;
                        g = false
                    }
                });
                if (g) Nb = true
            }
            var q = [],
                s = c.length - i - 1;
            for (var n = 0, t = vb.length; n < t; ++n) {
                var u = vb[n];
                if (u < a.line) q.push(u);
                else if (u > b.line) q.push(u + s)
            }
            var v = a.line + Math.min(c.length, 500);
            Td(a.line, v);
            q.push(v);
            vb = q;
            Vd(100);
            Hb.push({
                from: a.line,
                to: b.line + 1,
                diff: s
            });
            var w = {
                from: a,
                to: b,
                text: c
            };
            if (Ib) {
                for (var x = Ib; x.next; x = x.next) {}
                x.next = w
            } else Ib = w;
            Uc(d, e, y(xb.from.line), y(xb.to.line));
            if (U.clientHeight) W.style.height = ub.height * Gd() + 2 * Kd() + "px"
        }
        function wc() {
            var a = 0;
            Tb = "";
            Ub = null;
            ub.iter(0, ub.size, function (b) {
                var c = b.text;
                if (!b.hidden && c.length > a) {
                    a = c.length;
                    Tb = c
                }
            });
            Nb = false
        }
        function xc(a, b, c) {
            function d(d) {
                if (ab(d, b)) return d;
                if (!ab(c, d)) return e;
                var f = d.line + a.length - (c.line - b.line) - 1;
                var g = d.ch;
                if (d.line == c.line) g += a[a.length - 1].length - (c.ch - (c.line == b.line ? b.ch : 0));
                return {
                    line: f,
                    ch: g
                }
            }
            b = Yc(b);
            if (!c) c = b;
            else c = Yc(c);
            a = hb(a);
            var e;
            zc(a, b, c, function (a) {
                e = a;
                return {
                    from: d(xb.from),
                    to: d(xb.to)
                }
            });
            return e
        }
        function yc(a, b) {
            zc(hb(a), xb.from, xb.to, function (a) {
                if (b == "end") return {
                    from: a,
                    to: a
                };
                else if (b == "start") return {
                    from: xb.from,
                    to: xb.from
                };
                else return {
                    from: xb.from,
                    to: a
                }
            })
        }
        function zc(a, b, c, d) {
            var e = a.length == 1 ? a[0].length + b.ch : a[a.length - 1].length;
            var f = d({
                line: b.line + a.length - 1,
                ch: e
            });
            rc(b, c, a, f.from, f.to)
        }
        function Ac(a, b) {
            var c = a.line,
                d = b.line;
            if (c == d) return _b(c).text.slice(a.ch, b.ch);
            var e = [_b(c).text.slice(a.ch)];
            ub.iter(c + 1, d, function (a) {
                e.push(a.text)
            });
            e.push(_b(d).text.slice(0, b.ch));
            return e.join("\n")
        }
        function Bc() {
            return Ac(xb.from, xb.to)
        }
        function Dc() {
            if (Cc) return;
            qb.set(f.pollInterval, function () {
                Wd();
                Gc();
                if (wb) Dc();
                Xd()
            })
        }
        function Ec() {
            function b() {
                Wd();
                var c = Gc();
                if (!c && !a) {
                    a = true;
                    qb.set(60, b)
                } else {
                    Cc = false;
                    Dc()
                }
                Xd()
            }
            var a = false;
            Cc = true;
            qb.set(20, b)
        }
        function Gc() {
            if (Kb || !wb || ib(R) || f.readOnly) return false;
            var a = R.value;
            if (a == Fc) return false;
            yb = null;
            var b = 0,
                c = Math.min(Fc.length, a.length);
            while (b < c && Fc[b] == a[b])++b;
            if (b < Fc.length) xb.from = {
                line: xb.from.line,
                ch: xb.from.ch - (Fc.length - b)
            };
            else if (Db && _(xb.from, xb.to)) xb.to = {
                line: xb.to.line,
                ch: Math.min(_b(xb.to.line).text.length, xb.to.ch + (a.length - b))
            };
            yc(a.slice(b), "end");
            if (a.length > 1e3) {
                R.value = Fc = ""
            } else Fc = a;
            return true
        }
        function Hc(a) {
            if (!_(xb.from, xb.to)) {
                Fc = "";
                R.value = Bc();
                $(R)
            } else if (a) Fc = R.value = ""
        }
        function Ic() {
            if (f.readOnly != "nocursor") R.focus()
        }
        function Jc() {
            if (!mb.getBoundingClientRect) return;
            var a = mb.getBoundingClientRect();
            if (M && a.top == a.bottom) return;
            var b = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
            if (a.top < 0 || a.bottom > b) mb.scrollIntoView()
        }
        function Kc() {
            var a = Ad(xb.inverted ? xb.from : xb.to);
            var b = f.lineWrapping ? Math.min(a.x, kb.offsetWidth) : a.x;
            return Lc(b, a.y, b, a.yBot)
        }
        function Lc(a, b, c, d) {
            var e = Ld(),
                g = Kd();
            b += g;
            d += g;
            a += e;
            c += e;
            var h = U.clientHeight,
                i = U.scrollTop,
                j = false,
                k = true;
            if (b < i) {
                U.scrollTop = Math.max(0, b);
                j = true
            } else if (d > i + h) {
                U.scrollTop = d - h;
                j = true
            }
            var l = U.clientWidth,
                m = U.scrollLeft;
            var n = f.fixedGutter ? cb.clientWidth : 0;
            var o = a < n + e + 10;
            if (a < m + n || o) {
                if (o) a = 0;
                U.scrollLeft = Math.max(0, a - 10 - n);
                j = true
            } else if (c > l + m - 3) {
                U.scrollLeft = c + 10 - l;
                j = true;
                if (c > W.clientWidth) k = false
            }
            if (j && f.onScroll) f.onScroll($b);
            return k
        }
        function Mc() {
            var a = Gd(),
                b = U.scrollTop - Kd();
            var c = Math.max(0, Math.floor(b / a));
            var d = Math.ceil((b + U.clientHeight) / a);
            return {
                from: x(ub, c),
                to: x(ub, d)
            }
        }
        function Nc(a, b) {
            function n() {
                Ub = U.clientWidth;
                var a = ob.firstChild,
                    b = false;
                ub.iter(Pb, Qb, function (c) {
                    if (!c.hidden) {
                        var d = Math.round(a.offsetHeight / k) || 1;
                        if (c.height != d) {
                            ac(c, d);
                            Lb = b = true
                        }
                    }
                    a = a.nextSibling
                });
                if (b) W.style.height = ub.height * k + 2 * Kd() + "px";
                return b
            }
            if (!U.clientWidth) {
                Pb = Qb = Ob = 0;
                return
            }
            var c = Mc();
            if (a !== true && a.length == 0 && c.from > Pb && c.to < Qb) return;
            var d = Math.max(c.from - 100, 0),
                e = Math.min(ub.size, c.to + 100);
            if (Pb < d && d - Pb < 20) d = Pb;
            if (Qb > e && Qb - e < 20) e = Math.min(ub.size, Qb);
            var g = a === true ? [] : Oc([{
                from: Pb,
                to: Qb,
                domStart: 0
            }], a);
            var h = 0;
            for (var i = 0; i < g.length; ++i) {
                var j = g[i];
                if (j.from < d) {
                    j.domStart += d - j.from;
                    j.from = d
                }
                if (j.to > e) j.to = e;
                if (j.from >= j.to) g.splice(i--, 1);
                else h += j.to - j.from
            }
            if (h == e - d && d == Pb && e == Qb) return;
            g.sort(function (a, b) {
                return a.domStart - b.domStart
            });
            var k = Gd(),
                l = cb.style.display;
            ob.style.display = "none";
            Pc(d, e, g);
            ob.style.display = cb.style.display = "";
            var m = d != Pb || e != Qb || Rb != U.clientHeight + k;
            if (m) Rb = U.clientHeight + k;
            Pb = d;
            Qb = e;
            Ob = y(ub, d);
            X.style.top = Ob * k + "px";
            if (U.clientHeight) W.style.height = ub.height * k + 2 * Kd() + "px";
            if (ob.childNodes.length != Qb - Pb) throw new Error("BAD PATCH! " + JSON.stringify(g) + " size=" + (Qb - Pb) + " nodes=" + ob.childNodes.length);
            if (f.lineWrapping) {
                n()
            } else {
                if (Ub == null) Ub = wd(Tb);
                if (Ub > U.clientWidth) {
                    kb.style.width = Ub + "px";
                    W.style.width = "";
                    W.style.width = U.scrollWidth + "px"
                } else {
                    kb.style.width = W.style.width = ""
                }
            }
            cb.style.display = l;
            if (m || Lb) {
                Qc() && f.lineWrapping && n() && Qc()
            }
            Rc();
            if (!b && f.onUpdate) f.onUpdate($b);
            return true
        }
        function Oc(a, b) {
            for (var c = 0, d = b.length || 0; c < d; ++c) {
                var e = b[c],
                    f = [],
                    g = e.diff || 0;
                for (var h = 0, i = a.length; h < i; ++h) {
                    var j = a[h];
                    if (e.to <= j.from && e.diff) f.push({
                        from: j.from + g,
                        to: j.to + g,
                        domStart: j.domStart
                    });
                    else if (e.to <= j.from || e.from >= j.to) f.push(j);
                    else {
                        if (e.from > j.from) f.push({
                            from: j.from,
                            to: e.from,
                            domStart: j.domStart
                        });
                        if (e.to < j.to) f.push({
                            from: e.to + g,
                            to: j.to + g,
                            domStart: j.domStart + (e.to - j.from)
                        })
                    }
                }
                a = f
            }
            return a
        }
        function Pc(a, b, c) {
            if (!c.length) ob.innerHTML = "";
            else {
                function d(a) {
                    var b = a.nextSibling;
                    a.parentNode.removeChild(a);
                    return b
                }
                var e = 0,
                    f = ob.firstChild,
                    g;
                for (var h = 0; h < c.length; ++h) {
                    var i = c[h];
                    while (i.domStart > e) {
                        f = d(f);
                        e++
                    }
                    for (var j = 0, k = i.to - i.from; j < k; ++j) {
                        f = f.nextSibling;
                        e++
                    }
                }
                while (f) f = d(f)
            }
            var l = c.shift(),
                f = ob.firstChild,
                j = a;
            var m = document.createElement("div");
            ub.iter(a, b, function (a) {
                if (l && l.to == j) l = c.shift();
                if (!l || l.from > j) {
                    if (a.hidden) var b = m.innerHTML = "<pre></pre>";
                    else {
                        var b = "<pre" + (a.className ? ' class="' + a.className + '"' : "") + ">" + a.getHTML(jd) + "</pre>";
                        if (a.bgClassName) b = '<div style="position: relative"><pre class="' + a.bgClassName + '" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>' + b + "</div>"
                    }
                    m.innerHTML = b;
                    ob.insertBefore(m.firstChild, f)
                } else {
                    f = f.nextSibling
                }++j
            })
        }
        function Qc() {
            if (!f.gutter && !f.lineNumbers) return;
            var a = X.offsetHeight,
                b = U.clientHeight;
            cb.style.height = (a - b < 2 ? b : a) + "px";
            var c = [],
                d = Pb,
                e;
            ub.iter(Pb, Math.max(Qb, Pb + 1), function (a) {
                if (a.hidden) {
                    c.push("<pre></pre>")
                } else {
                    var b = a.gutterMarker;
                    var g = f.lineNumbers ? d + f.firstLineNumber : null;
                    if (b && b.text) g = b.text.replace("%N%", g != null ? g : "");
                    else if (g == null) g = " ";
                    c.push(b && b.style ? '<pre class="' + b.style + '">' : "<pre>", g);
                    for (var h = 1; h < a.height; ++h) c.push("<br/>&#160;");
                    c.push("</pre>");
                    if (!b) e = d
                }++d
            });
            cb.style.display = "none";
            db.innerHTML = c.join("");
            if (e != null) {
                var g = db.childNodes[e - Pb];
                var h = String(ub.size).length,
                    i = Z(g),
                    j = "";
                while (i.length + j.length < h) j += " ";
                if (j) g.insertBefore(document.createTextNode(j), g.firstChild)
            }
            cb.style.display = "";
            var k = Math.abs((parseInt(kb.style.marginLeft) || 0) - cb.offsetWidth) > 2;
            kb.style.marginLeft = cb.offsetWidth + "px";
            Lb = false;
            return k
        }
        function Rc() {
            var a = _(xb.from, xb.to);
            var b = Ad(xb.from, true);
            var c = a ? b : Ad(xb.to, true);
            var d = xb.inverted ? b : c,
                e = Gd();
            var g = Y(A),
                h = Y(ob);
            D.style.top = Math.max(0, Math.min(U.offsetHeight, d.y + h.top - g.top)) + "px";
            D.style.left = Math.max(0, Math.min(U.offsetWidth, d.x + h.left - g.left)) + "px";
            if (a) {
                mb.style.top = d.y + "px";
                mb.style.left = (f.lineWrapping ? Math.min(d.x, kb.offsetWidth) : d.x) + "px";
                mb.style.display = "";
                nb.style.display = "none"
            } else {
                var i = b.y == c.y,
                    j = "";
                var k = kb.clientWidth || kb.offsetWidth;
                var l = kb.clientHeight || kb.offsetHeight;

                function m(a, b, c, d) {
                    var e = O ? "width: " + (!c ? k : k - c - a) + "px" : "right: " + c + "px";
                    j += '<div class="CodeMirror-selected" style="position: absolute; left: ' + a + "px; top: " + b + "px; " + e + "; height: " + d + 'px"></div>'
                }
                if (xb.from.ch && b.y >= 0) {
                    var n = i ? k - c.x : 0;
                    m(b.x, b.y, n, e)
                }
                var o = Math.max(0, b.y + (xb.from.ch ? e : 0));
                var p = Math.min(c.y, l) - o;
                if (p > .2 * e) m(0, o, 0, p);
                if ((!i || !xb.from.ch) && c.y < l - .5 * e) m(0, c.y, k - c.x, e);
                nb.innerHTML = j;
                mb.style.display = "none";
                nb.style.display = ""
            }
        }
        function Sc(a) {
            if (a) yb = yb || (xb.inverted ? xb.to : xb.from);
            else yb = null
        }
        function Tc(a, b) {
            var c = yb && Yc(yb);
            if (c) {
                if (ab(c, a)) a = c;
                else if (ab(b, c)) b = c
            }
            Uc(a, b);
            Gb = true
        }
        function Uc(a, b, c, d) {
            ad = null;
            if (c == null) {
                c = xb.from.line;
                d = xb.to.line
            }
            if (_(xb.from, a) && _(xb.to, b)) return;
            if (ab(b, a)) {
                var e = b;
                b = a;
                a = e
            }
            if (a.line != c) {
                var g = Vc(a, c, xb.from.ch);
                if (!g) ud(a.line, false);
                else a = g
            }
            if (b.line != d) b = Vc(b, d, xb.to.ch);
            if (_(a, b)) xb.inverted = false;
            else if (_(a, xb.to)) xb.inverted = false;
            else if (_(b, xb.from)) xb.inverted = true;
            if (f.autoClearEmptyLines && _(xb.from, xb.to)) {
                var h = xb.inverted ? a : b;
                if (h.line != xb.from.line && xb.from.line < ub.size) {
                    var i = _b(xb.from.line);
                    if (/^\s+$/.test(i.text)) setTimeout(Zd(function () {
                        if (i.parent && /^\s+$/.test(i.text)) {
                            var a = w(i);
                            xc("", {
                                line: a,
                                ch: 0
                            }, {
                                line: a,
                                ch: i.text.length
                            })
                        }
                    }, 10))
                }
            }
            xb.from = a;
            xb.to = b;
            Jb = true
        }
        function Vc(a, b, c) {
            function d(b) {
                var d = a.line + b,
                    e = b == 1 ? ub.size : -1;
                while (d != e) {
                    var g = _b(d);
                    if (!g.hidden) {
                        var h = a.ch;
                        if (f || h > c || h > g.text.length) h = g.text.length;
                        return {
                            line: d,
                            ch: h
                        }
                    }
                    d += b
                }
            }
            var e = _b(a.line);
            var f = a.ch == e.text.length && a.ch != c;
            if (!e.hidden) return a;
            if (a.line >= b) return d(1) || d(-1);
            else return d(-1) || d(1)
        }
        function Wc(a, b, c) {
            var d = Yc({
                line: a,
                ch: b || 0
            });
            (c ? Tc : Uc)(d, d)
        }
        function Xc(a) {
            return Math.max(0, Math.min(a, ub.size - 1))
        }
        function Yc(a) {
            if (a.line < 0) return {
                line: 0,
                ch: 0
            };
            if (a.line >= ub.size) return {
                line: ub.size - 1,
                ch: _b(ub.size - 1).text.length
            };
            var b = a.ch,
                c = _b(a.line).text.length;
            if (b == null || b > c) return {
                line: a.line,
                ch: c
            };
            else if (b < 0) return {
                line: a.line,
                ch: 0
            };
            else return a
        }
        function Zc(a, b) {
            function g() {
                for (var b = d + a, c = a < 0 ? -1 : ub.size; b != c; b += a) {
                    var e = _b(b);
                    if (!e.hidden) {
                        d = b;
                        f = e;
                        return true
                    }
                }
            }
            function h(b) {
                if (e == (a < 0 ? 0 : f.text.length)) {
                    if (!b && g()) e = a < 0 ? f.text.length : 0;
                    else return false
                } else e += a;
                return true
            }
            var c = xb.inverted ? xb.from : xb.to,
                d = c.line,
                e = c.ch;
            var f = _b(d);
            if (b == "char") h();
            else if (b == "column") h(true);
            else if (b == "word") {
                var i = false;
                for (;;) {
                    if (a < 0) if (!h()) break;
                    if (gb(f.text.charAt(e))) i = true;
                    else if (i) {
                        if (a < 0) {
                            a = 1;
                            h()
                        }
                        break
                    }
                    if (a > 0) if (!h()) break
                }
            }
            return {
                line: d,
                ch: e
            }
        }
        function $c(a, b) {
            var c = a < 0 ? xb.from : xb.to;
            if (yb || _(xb.from, xb.to)) c = Zc(a, b);
            Wc(c.line, c.ch, true)
        }
        function _c(a, b) {
            if (!_(xb.from, xb.to)) xc("", xb.from, xb.to);
            else if (a < 0) xc("", Zc(a, b), xb.to);
            else xc("", xb.from, Zc(a, b));
            Gb = true
        }
        function bd(a, b) {
            var c = 0,
                d = Ad(xb.inverted ? xb.from : xb.to, true);
            if (ad != null) d.x = ad;
            if (b == "page") c = Math.min(U.clientHeight, window.innerHeight || document.documentElement.clientHeight);
            else if (b == "line") c = Gd();
            var e = Bd(d.x, d.y + c * a + 2);
            if (b == "page") U.scrollTop += Ad(e, true).y - d.y;
            Wc(e.line, e.ch, true);
            ad = d.x
        }
        function cd(a) {
            var b = _b(a.line).text;
            var c = a.ch,
                d = a.ch;
            while (c > 0 && gb(b.charAt(c - 1)))--c;
            while (d < b.length && gb(b.charAt(d)))++d;
            Tc({
                line: a.line,
                ch: c
            }, {
                line: a.line,
                ch: d
            })
        }
        function dd(a) {
            Tc({
                line: a,
                ch: 0
            }, Yc({
                line: a + 1,
                ch: 0
            }))
        }
        function ed(a) {
            if (_(xb.from, xb.to)) return fd(xb.from.line, a);
            var b = xb.to.line - (xb.to.ch ? 0 : 1);
            for (var c = xb.from.line; c <= b; ++c) fd(c, a)
        }
        function fd(a, b) {
            if (!b) b = "add";
            if (b == "smart") {
                if (!tb.indent) b = "prev";
                else var c = Sd(a)
            }
            var d = _b(a),
                e = d.indentation(f.tabSize),
                g = d.text.match(/^\s*/)[0],
                h;
            if (b == "prev") {
                if (a) h = _b(a - 1).indentation(f.tabSize);
                else h = 0
            } else if (b == "smart") h = tb.indent(c, d.text.slice(g.length), d.text);
            else if (b == "add") h = e + f.indentUnit;
            else if (b == "subtract") h = e - f.indentUnit;
            h = Math.max(0, h);
            var i = h - e;
            if (!i) {
                if (xb.from.line != a && xb.to.line != a) return;
                var j = g
            } else {
                var j = "",
                    k = 0;
                if (f.indentWithTabs) for (var l = Math.floor(h / f.tabSize); l; --l) {
                    k += f.tabSize;
                    j += "	"
                }
                while (k < h) {
                    ++k;
                    j += " "
                }
            }
            xc(j, {
                line: a,
                ch: 0
            }, {
                line: a,
                ch: g.length
            })
        }
        function gd() {
            tb = a.getMode(f, f.mode);
            ub.iter(0, ub.size, function (a) {
                a.stateAfter = null
            });
            vb = [0];
            Vd()
        }
        function hd() {
            var a = f.gutter || f.lineNumbers;
            cb.style.display = a ? "" : "none";
            if (a) Lb = true;
            else ob.parentNode.style.marginLeft = 0
        }
        function id(a, b) {
            if (f.lineWrapping) {
                A.className += " CodeMirror-wrap";
                var c = U.clientWidth / Jd() - 3;
                ub.iter(0, ub.size, function (a) {
                    if (a.hidden) return;
                    var b = Math.ceil(a.text.length / c) || 1;
                    if (b != 1) ac(a, b)
                });
                kb.style.width = W.style.width = ""
            } else {
                A.className = A.className.replace(" CodeMirror-wrap", "");
                Ub = null;
                Tb = "";
                ub.iter(0, ub.size, function (a) {
                    if (a.height != 1 && !a.hidden) ac(a, 1);
                    if (a.text.length > Tb.length) Tb = a.text
                })
            }
            Hb.push({
                from: 0,
                to: ub.size
            })
        }
        function jd(a) {
            var b = f.tabSize - a % f.tabSize,
                c = Vb[b];
            if (c) return c;
            for (var d = '<span class="cm-tab">', e = 0; e < b; ++e) d += " ";
            return Vb[b] = {
                html: d + "</span>",
                width: b
            }
        }
        function kd() {
            U.className = U.className.replace(/\s*cm-s-\S+/g, "") + f.theme.replace(/(^|\s)\s*/g, " cm-s-")
        }
        function ld() {
            var a = i[f.keyMap].style;
            A.className = A.className.replace(/\s*cm-keymap-\S+/g, "") + (a ? " cm-keymap-" + a : "")
        }
        function md() {
            this.set = []
        }
        function nd(a, b, c) {
            function e(a, b, c, e) {
                _b(a).addMark(new p(b, c, e, d))
            }
            a = Yc(a);
            b = Yc(b);
            var d = new md;
            if (!ab(a, b)) return d;
            if (a.line == b.line) e(a.line, a.ch, b.ch, c);
            else {
                e(a.line, a.ch, null, c);
                for (var f = a.line + 1, g = b.line; f < g; ++f) e(f, null, null, c);
                e(b.line, null, b.ch, c)
            }
            Hb.push({
                from: a.line,
                to: b.line + 1
            });
            return d
        }
        function od(a) {
            a = Yc(a);
            var b = new q(a.ch);
            _b(a.line).addMark(b);
            return b
        }
        function pd(a) {
            a = Yc(a);
            var b = [],
                c = _b(a.line).marked;
            if (!c) return b;
            for (var d = 0, e = c.length; d < e; ++d) {
                var f = c[d];
                if ((f.from == null || f.from <= a.ch) && (f.to == null || f.to >= a.ch)) b.push(f.marker || f)
            }
            return b
        }
        function qd(a, b, c) {
            if (typeof a == "number") a = _b(Xc(a));
            a.gutterMarker = {
                text: b,
                style: c
            };
            Lb = true;
            return a
        }
        function rd(a) {
            if (typeof a == "number") a = _b(Xc(a));
            a.gutterMarker = null;
            Lb = true
        }
        function sd(a, b) {
            var c = a,
                d = a;
            if (typeof a == "number") d = _b(Xc(a));
            else c = w(a);
            if (c == null) return null;
            if (b(d, c)) Hb.push({
                from: c,
                to: c + 1
            });
            else return null;
            return d
        }
        function td(a, b, c) {
            return sd(a, function (a) {
                if (a.className != b || a.bgClassName != c) {
                    a.className = b;
                    a.bgClassName = c;
                    return true
                }
            })
        }
        function ud(a, b) {
            return sd(a, function (a, c) {
                if (a.hidden != b) {
                    a.hidden = b;
                    if (!f.lineWrapping) {
                        var d = a.text;
                        if (b && d.length == Tb.length) {
                            Nb = true
                        } else if (!b && d.length > Tb.length) {
                            Tb = d;
                            Ub = null;
                            Nb = false
                        }
                    }
                    ac(a, b ? 0 : 1);
                    var e = xb.from.line,
                        g = xb.to.line;
                    if (b && (e == c || g == c)) {
                        var h = e == c ? Vc({
                            line: e,
                            ch: 0
                        }, e, 0) : xb.from;
                        var i = g == c ? Vc({
                            line: g,
                            ch: 0
                        }, g, 0) : xb.to;
                        if (!i) return;
                        Uc(h, i)
                    }
                    return Lb = true
                }
            })
        }
        function vd(a) {
            if (typeof a == "number") {
                if (!Zb(a)) return null;
                var b = a;
                a = _b(a);
                if (!a) return null
            } else {
                var b = w(a);
                if (b == null) return null
            }
            var c = a.gutterMarker;
            return {
                line: b,
                handle: a,
                text: a.text,
                markerText: c && c.text,
                markerClass: c && c.style,
                lineClass: a.className,
                bgClass: a.bgClassName
            }
        }
        function wd(a) {
            lb.innerHTML = "<pre><span>x</span></pre>";
            lb.firstChild.firstChild.firstChild.nodeValue = a;
            return lb.firstChild.firstChild.offsetWidth || 10
        }
        function xd(a, b) {
            function e(a) {
                return zd(c, a).left
            }
            if (b <= 0) return 0;
            var c = _b(a),
                d = c.text;
            var f = 0,
                g = 0,
                h = d.length,
                i;
            var j = Math.min(h, Math.ceil(b / Jd()));
            for (;;) {
                var k = e(j);
                if (k <= b && j < h) j = Math.min(h, Math.ceil(j * 1.2));
                else {
                    i = k;
                    h = j;
                    break
                }
            }
            if (b > i) return h;
            j = Math.floor(h * .8);
            k = e(j);
            if (k < b) {
                f = j;
                g = k
            }
            for (;;) {
                if (h - f <= 1) return i - b > b - g ? f : h;
                var l = Math.ceil((f + h) / 2),
                    m = e(l);
                if (m > b) {
                    h = l;
                    i = m
                } else {
                    f = l;
                    g = m
                }
            }
        }
        function zd(a, b) {
            if (b == 0) return {
                top: 0,
                left: 0
            };
            var c = f.lineWrapping && b < a.text.length && V.test(a.text.slice(b - 1, b + 1));
            lb.innerHTML = "<pre>" + a.getHTML(jd, b, yd, c) + "</pre>";
            var d = document.getElementById(yd);
            var e = d.offsetTop,
                g = d.offsetLeft;
            if (M && e == 0 && g == 0) {
                var h = document.createElement("span");
                h.innerHTML = "x";
                d.parentNode.insertBefore(h, d.nextSibling);
                e = h.offsetTop
            }
            return {
                top: e,
                left: g
            }
        }
        function Ad(a, b) {
            var c, d = Gd(),
                e = d * (y(ub, a.line) - (b ? Ob : 0));
            if (a.ch == 0) c = 0;
            else {
                var g = zd(_b(a.line), a.ch);
                c = g.left;
                if (f.lineWrapping) e += Math.max(0, g.top)
            }
            return {
                x: c,
                y: e,
                yBot: e + d
            }
        }
        function Bd(a, b) {
            function l(a) {
                var b = zd(h, a);
                if (j) {
                    var d = Math.round(b.top / c);
                    return Math.max(0, b.left + (d - k) * U.clientWidth)
                }
                return b.left
            }
            if (b < 0) b = 0;
            var c = Gd(),
                d = Jd(),
                e = Ob + Math.floor(b / c);
            var g = x(ub, e);
            if (g >= ub.size) return {
                line: ub.size - 1,
                ch: _b(ub.size - 1).text.length
            };
            var h = _b(g),
                i = h.text;
            var j = f.lineWrapping,
                k = j ? e - y(ub, g) : 0;
            if (a <= 0 && k == 0) return {
                line: g,
                ch: 0
            };
            var m = 0,
                n = 0,
                o = i.length,
                p;
            var q = Math.min(o, Math.ceil((a + k * U.clientWidth * .9) / d));
            for (;;) {
                var r = l(q);
                if (r <= a && q < o) q = Math.min(o, Math.ceil(q * 1.2));
                else {
                    p = r;
                    o = q;
                    break
                }
            }
            if (a > p) return {
                line: g,
                ch: o
            };
            q = Math.floor(o * .8);
            r = l(q);
            if (r < a) {
                m = q;
                n = r
            }
            for (;;) {
                if (o - m <= 1) return {
                    line: g,
                    ch: p - a > a - n ? m : o
                };
                var s = Math.ceil((m + o) / 2),
                    t = l(s);
                if (t > a) {
                    o = s;
                    p = t
                } else {
                    m = s;
                    n = t
                }
            }
        }
        function Cd(a) {
            var b = Ad(a, true),
                c = Y(kb);
            return {
                x: c.left + b.x,
                y: c.top + b.y,
                yBot: c.top + b.yBot
            }
        }
        function Gd() {
            if (Fd == null) {
                Fd = "<pre>";
                for (var a = 0; a < 49; ++a) Fd += "x<br/>";
                Fd += "x</pre>"
            }
            var b = ob.clientHeight;
            if (b == Ed) return Dd;
            Ed = b;
            lb.innerHTML = Fd;
            Dd = lb.firstChild.offsetHeight / 50 || 1;
            lb.innerHTML = "";
            return Dd
        }
        function Jd() {
            if (U.clientWidth == Id) return Hd;
            Id = U.clientWidth;
            return Hd = wd("x")
        }
        function Kd() {
            return kb.offsetTop
        }
        function Ld() {
            return kb.offsetLeft
        }
        function Md(a, b) {
            var c = Y(U, true),
                d, e;
            try {
                d = a.clientX;
                e = a.clientY
            } catch (a) {
                return null
            }
            if (!b && (d - c.left > U.clientWidth || e - c.top > U.clientHeight)) return null;
            var f = Y(kb, true);
            return Bd(d - f.left, e - f.top)
        }
        function Nd(a) {
            function f() {
                var a = hb(R.value).join("\n");
                if (a != e) Zd(yc)(a, "end");
                D.style.position = "relative";
                R.style.cssText = d;
                if (N) U.scrollTop = c;
                Kb = false;
                Hc(true);
                Dc()
            }
            var b = Md(a),
                c = U.scrollTop;
            if (!b || window.opera) return;
            if (_(xb.from, xb.to) || ab(b, xb.from) || !ab(b, xb.to)) Zd(Wc)(b.line, b.ch);
            var d = R.style.cssText;
            D.style.position = "absolute";
            R.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (a.clientY - 5) + "px; left: " + (a.clientX - 5) + "px; z-index: 1000; background: white; " + "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
            Kb = true;
            var e = R.value = Bc();
            Ic();
            $(R);
            if (L) {
                E(a);
                var g = I(window, "mouseup", function () {
                    g();
                    setTimeout(f, 20)
                }, true)
            } else {
                setTimeout(f, 50)
            }
        }
        function Od() {
            clearInterval(sb);
            var a = true;
            mb.style.visibility = "";
            sb = setInterval(function () {
                mb.style.visibility = (a = !a) ? "" : "hidden"
            }, 650)
        }
        function Qd(a) {
            function p(a, b, c) {
                if (!a.text) return;
                var d = a.styles,
                    e = g ? 0 : a.text.length - 1,
                    f;
                for (var i = g ? 0 : d.length - 2, j = g ? d.length : -2; i != j; i += 2 * h) {
                    var k = d[i];
                    if (d[i + 1] != null && d[i + 1] != m) {
                        e += h * k.length;
                        continue
                    }
                    for (var l = g ? 0 : k.length - 1, p = g ? k.length : -1; l != p; l += h, e += h) {
                        if (e >= b && e < c && o.test(f = k.charAt(l))) {
                            var q = Pd[f];
                            if (q.charAt(1) == ">" == g) n.push(f);
                            else if (n.pop() != q.charAt(0)) return {
                                pos: e,
                                match: false
                            };
                            else if (!n.length) return {
                                pos: e,
                                match: true
                            }
                        }
                    }
                }
            }
            var b = xb.inverted ? xb.from : xb.to,
                c = _b(b.line),
                d = b.ch - 1;
            var e = d >= 0 && Pd[c.text.charAt(d)] || Pd[c.text.charAt(++d)];
            if (!e) return;
            var f = e.charAt(0),
                g = e.charAt(1) == ">",
                h = g ? 1 : -1,
                i = c.styles;
            for (var j = d + 1, k = 0, l = i.length; k < l; k += 2) if ((j -= i[k].length) <= 0) {
                var m = i[k + 1];
                break
            }
            var n = [c.text.charAt(d)],
                o = /[(){}[\]]/;
            for (var k = b.line, l = g ? Math.min(k + 100, ub.size) : Math.max(-1, k - 100); k != l; k += h) {
                var c = _b(k),
                    q = k == b.line;
                var r = p(c, q && g ? d + 1 : 0, q && !g ? d : c.text.length);
                if (r) break
            }
            if (!r) r = {
                pos: null,
                match: false
            };
            var m = r.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
            var s = nd({
                line: b.line,
                ch: d
            }, {
                line: b.line,
                ch: d + 1
            }, m),
                t = r.pos != null && nd({
                    line: k,
                    ch: r.pos
                }, {
                    line: k,
                    ch: r.pos + 1
                }, m);
            var u = Zd(function () {
                s.clear();
                t && t.clear()
            });
            if (a) setTimeout(u, 800);
            else Sb = u
        }
        function Rd(a) {
            var b, c;
            for (var d = a, e = a - 40; d > e; --d) {
                if (d == 0) return 0;
                var g = _b(d - 1);
                if (g.stateAfter) return d;
                var h = g.indentation(f.tabSize);
                if (c == null || b > h) {
                    c = d - 1;
                    b = h
                }
            }
            return c
        }
        function Sd(a) {
            var b = Rd(a),
                c = b && _b(b - 1).stateAfter;
            if (!c) c = n(tb);
            else c = m(tb, c);
            ub.iter(b, a, function (a) {
                a.highlight(tb, c, f.tabSize);
                a.stateAfter = m(tb, c)
            });
            if (b < a) Hb.push({
                from: b,
                to: a
            });
            if (a < ub.size && !_b(a).stateAfter) vb.push(a);
            return c
        }
        function Td(a, b) {
            var c = Sd(a);
            ub.iter(a, b, function (a) {
                a.highlight(tb, c, f.tabSize);
                a.stateAfter = m(tb, c)
            })
        }
        function Ud() {
            var a = +(new Date) + f.workTime;
            var b = vb.length;
            while (vb.length) {
                if (!_b(Pb).stateAfter) var c = Pb;
                else var c = vb.pop();
                if (c >= ub.size) continue;
                var d = Rd(c),
                    e = d && _b(d - 1).stateAfter;
                if (e) e = m(tb, e);
                else e = n(tb);
                var g = 0,
                    h = tb.compareStates,
                    i = false,
                    j = d,
                    k = false;
                ub.iter(j, ub.size, function (b) {
                    var d = b.stateAfter;
                    if (+(new Date) > a) {
                        vb.push(j);
                        Vd(f.workDelay);
                        if (i) Hb.push({
                            from: c,
                            to: j + 1
                        });
                        return k = true
                    }
                    var l = b.highlight(tb, e, f.tabSize);
                    if (l) i = true;
                    b.stateAfter = m(tb, e);
                    var n = null;
                    if (h) {
                        var o = d && h(d, e);
                        if (o != K) n = !! o
                    }
                    if (n == null) {
                        if (l !== false || !d) g = 0;
                        else if (++g > 3 && (!tb.indent || tb.indent(d, "") == tb.indent(e, ""))) n = true
                    }
                    if (n) return true;
                    ++j
                });
                if (k) return;
                if (i) Hb.push({
                    from: c,
                    to: j + 1
                })
            }
            if (b && f.onHighlightComplete) f.onHighlightComplete($b)
        }
        function Vd(a) {
            if (!vb.length) return;
            rb.set(a, Zd(Ud))
        }
        function Wd() {
            Fb = Gb = Ib = null;
            Hb = [];
            Jb = false;
            Mb = []
        }
        function Xd() {
            var a = false,
                b;
            if (Nb) wc();
            if (Jb) a = !Kc();
            if (Hb.length) b = Nc(Hb, true);
            else {
                if (Jb) Rc();
                if (Lb) Qc()
            }
            if (a) Kc();
            if (Jb) {
                Jc();
                Od()
            }
            if (wb && !Kb && (Fb === true || Fb !== false && Jb)) Hc(Gb);
            if (Jb && f.matchBrackets) setTimeout(Zd(function () {
                if (Sb) {
                    Sb();
                    Sb = null
                }
                if (_(xb.from, xb.to)) Qd(false)
            }), 20);
            var c = Ib,
                d = Mb;
            if (Jb && f.onCursorActivity) f.onCursorActivity($b);
            if (c && f.onChange && $b) f.onChange($b, c);
            for (var e = 0; e < d.length; ++e) d[e]($b);
            if (b && f.onUpdate) f.onUpdate($b)
        }
        function Zd(a) {
            return function () {
                if (!(Yd++)) Wd();
                try {
                    var b = a.apply(this, arguments)
                } finally {
                    if (!--Yd) Xd()
                }
                return b
            }
        }
        function $d(a) {
            Wb.startCompound();
            try {
                return a()
            } finally {
                Wb.endCompound()
            }
        }
        var f = {}, o = a.defaults;
        for (var s in o) if (o.hasOwnProperty(s)) f[s] = (e && e.hasOwnProperty(s) ? e : o)[s];
        var A = document.createElement("div");
        A.className = "CodeMirror" + (f.lineWrapping ? " CodeMirror-wrap" : "");
        A.innerHTML = '<div style="overflow: hidden; position: relative; width: 3px; height: 0px;">' + '<textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" ' + 'autocorrect="off" autocapitalize="off"></textarea></div>' + '<div class="CodeMirror-scroll" tabindex="-1">' + '<div style="position: relative;line-height:20px;">' + '<div style="position: relative;">' + '<div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div>' + '<div class="CodeMirror-lines"><div style="position: relative; z-index: 0;">' + '<div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div>' + '<pre class="CodeMirror-cursor">&#160;</pre>' + '<div style="position: relative; z-index: -1;"></div><div style="margin-bottom:30px;"></div>' + "</div></div></div></div></div>";
        if (d.appendChild) d.appendChild(A);
        else d(A);
        var D = A.firstChild,
            R = D.firstChild,
            U = A.lastChild,
            W = U.firstChild,
            X = W.firstChild,
            cb = X.firstChild,
            db = cb.firstChild,
            kb = cb.nextSibling.firstChild,
            lb = kb.firstChild,
            mb = lb.nextSibling,
            nb = mb.nextSibling,
            ob = nb.nextSibling;
        kd();
        ld();
        if (b) R.style.width = "0px";
        if (!P) kb.draggable = true;
        kb.style.outline = "none";
        if (f.tabindex != null) R.tabIndex = f.tabindex;
        if (f.autofocus) Ic();
        if (!f.gutter && !f.lineNumbers) cb.style.display = "none";
        if (S) D.style.height = "1px", D.style.position = "absolute";
        try {
            wd("x")
        } catch (pb) {
            if (pb.message.match(/runtime/i)) pb = new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)");
            throw pb
        }
        var qb = new J,
            rb = new J,
            sb;
        var tb, ub = new u([new t([new r("")])]),
            vb, wb;
        gd();
        var xb = {
            from: {
                line: 0,
                ch: 0
            },
            to: {
                line: 0,
                ch: 0
            },
            inverted: false
        };
        var yb, zb, Ab, Bb = 0,
            Cb, Db = false,
            Eb = false;
        var Fb, Gb, Hb, Ib, Jb, Kb, Lb, Mb, Nb;
        var Ob = 0,
            Pb = 0,
            Qb = 0,
            Rb = 0;
        var Sb;
        var Tb = "",
            Ub;
        var Vb = {};
        Zd(function () {
            bc(f.value || "");
            Fb = false
        })();
        var Wb = new z;
        I(U, "mousedown", Zd(dc));
        I(U, "dblclick", Zd(ec));
        I(kb, "selectstart", C);
        if (!L) I(U, "contextmenu", Nd);
        I(U, "scroll", function () {
            Bb = U.scrollTop;
            Nc([]);
            if (f.fixedGutter) cb.style.left = U.scrollLeft + "px";
            if (f.onScroll) f.onScroll($b)
        });
        I(window, "resize", function () {
            Nc(true)
        });
        I(R, "keyup", Zd(oc));
        I(R, "input", Ec);
        I(R, "keydown", Zd(mc));
        I(R, "keypress", Zd(nc));
        I(R, "focus", pc);
        I(R, "blur", qc);
        if (f.dragDrop) {
            I(kb, "dragstart", gc);

            function Xb(a) {
                if (f.onDragEvent && f.onDragEvent($b, B(a))) return;
                E(a)
            }
            I(U, "dragenter", Xb);
            I(U, "dragover", Xb);
            I(U, "drop", Zd(fc))
        }
        I(U, "paste", function () {
            Ic();
            Ec()
        });
        I(R, "paste", Ec);
        I(R, "cut", Zd(function () {
            if (!f.readOnly) yc("")
        }));
        if (S) I(W, "mouseup", function () {
            if (document.activeElement == R) R.blur();
            Ic()
        });
        var Yb;
        try {
            Yb = document.activeElement == R
        } catch (pb) {}
        if (Yb || f.autofocus) setTimeout(pc, 20);
        else qc();
        var $b = A.CodeMirror = {
            getValue: cc,
            setValue: Zd(bc),
            getSelection: Bc,
            replaceSelection: Zd(yc),
            focus: function () {
                window.focus();
                Ic();
                pc();
                Ec()
            },
            setOption: function (a, b) {
                var c = f[a];
                f[a] = b;
                if (a == "mode" || a == "indentUnit") gd();
                else if (a == "readOnly" && b == "nocursor") {
                    qc();
                    R.blur()
                } else if (a == "readOnly" && !b) {
                    Hc(true)
                } else if (a == "theme") kd();
                else if (a == "lineWrapping" && c != b) Zd(id)();
                else if (a == "tabSize") Nc(true);
                else if (a == "keyMap") ld();
                if (a == "lineNumbers" || a == "gutter" || a == "firstLineNumber" || a == "theme") {
                    hd();
                    Nc(true)
                }
            },
            getOption: function (a) {
                return f[a]
            },
            undo: Zd(tc),
            redo: Zd(uc),
            indentLine: Zd(function (a, b) {
                if (typeof b != "string") {
                    if (b == null) b = f.smartIndent ? "smart" : "prev";
                    else b = b ? "add" : "subtract"
                }
                if (Zb(a)) fd(a, b)
            }),
            indentSelection: Zd(ed),
            historySize: function () {
                return {
                    undo: Wb.done.length,
                    redo: Wb.undone.length
                }
            },
            clearHistory: function () {
                Wb = new z
            },
            matchBrackets: Zd(function () {
                Qd(true)
            }),
            getTokenAt: Zd(function (a) {
                a = Yc(a);
                return _b(a.line).getTokenAt(tb, Sd(a.line), a.ch)
            }),
            getStateAfter: function (a) {
                a = Xc(a == null ? ub.size - 1 : a);
                return Sd(a + 1)
            },
            cursorCoords: function (a, b) {
                if (a == null) a = xb.inverted;
                return this.charCoords(a ? xb.from : xb.to, b)
            },
            charCoords: function (a, b) {
                a = Yc(a);
                if (b == "local") return Ad(a, false);
                if (b == "div") return Ad(a, true);
                return Cd(a)
            },
            coordsChar: function (a) {
                var b = Y(kb);
                return Bd(a.x - b.left, a.y - b.top)
            },
            markText: Zd(nd),
            setBookmark: od,
            findMarksAt: pd,
            setMarker: Zd(qd),
            clearMarker: Zd(rd),
            setLineClass: Zd(td),
            hideLine: Zd(function (a) {
                return ud(a, true)
            }),
            showLine: Zd(function (a) {
                return ud(a, false)
            }),
            onDeleteLine: function (a, b) {
                if (typeof a == "number") {
                    if (!Zb(a)) return null;
                    a = _b(a)
                }(a.handlers || (a.handlers = [])).push(b);
                return a
            },
            lineInfo: vd,
            addWidget: function (a, b, c, d, e) {
                a = Ad(Yc(a));
                var f = a.yBot,
                    g = a.x;
                b.style.position = "absolute";
                W.appendChild(b);
                if (d == "over") f = a.y;
                else if (d == "near") {
                    var h = Math.max(U.offsetHeight, ub.height * Gd()),
                        i = Math.max(W.clientWidth, kb.clientWidth) - Ld();
                    if (a.yBot + b.offsetHeight > h && a.y > b.offsetHeight) f = a.y - b.offsetHeight;
                    if (g + b.offsetWidth > i) g = i - b.offsetWidth
                }
                b.style.top = f + Kd() + "px";
                b.style.left = b.style.right = "";
                if (e == "right") {
                    g = W.clientWidth - b.offsetWidth;
                    b.style.right = "0px"
                } else {
                    if (e == "left") g = 0;
                    else if (e == "middle") g = (W.clientWidth - b.offsetWidth) / 2;
                    b.style.left = g + Ld() + "px"
                }
                if (c) Lc(g, f, g + b.offsetWidth, f + b.offsetHeight)
            },
            lineCount: function () {
                return ub.size
            },
            clipPos: Yc,
            getCursor: function (a) {
                if (a == null) a = xb.inverted;
                return bb(a ? xb.from : xb.to)
            },
            somethingSelected: function () {
                return !_(xb.from, xb.to)
            },
            setCursor: Zd(function (a, b, c) {
                if (b == null && typeof a.line == "number") Wc(a.line, a.ch, c);
                else Wc(a, b, c)
            }),
            setSelection: Zd(function (a, b, c) {
                (c ? Tc : Uc)(Yc(a), Yc(b || a))
            }),
            getLine: function (a) {
                if (Zb(a)) return _b(a).text
            },
            getLineHandle: function (a) {
                if (Zb(a)) return _b(a)
            },
            setLine: Zd(function (a, b) {
                if (Zb(a)) xc(b, {
                    line: a,
                    ch: 0
                }, {
                    line: a,
                    ch: _b(a).text.length
                })
            }),
            removeLine: Zd(function (a) {
                if (Zb(a)) xc("", {
                    line: a,
                    ch: 0
                }, Yc({
                    line: a + 1,
                    ch: 0
                }))
            }),
            replaceRange: Zd(xc),
            getRange: function (a, b) {
                return Ac(Yc(a), Yc(b))
            },
            triggerOnKeyDown: Zd(mc),
            execCommand: function (a) {
                return h[a]($b)
            },
            moveH: Zd($c),
            deleteH: Zd(_c),
            moveV: Zd(bd),
            toggleOverwrite: function () {
                if (Db) {
                    Db = false;
                    mb.className = mb.className.replace(" CodeMirror-overwrite", "")
                } else {
                    Db = true;
                    mb.className += " CodeMirror-overwrite"
                }
            },
            posFromIndex: function (a) {
                var b = 0,
                    c;
                ub.iter(0, ub.size, function (d) {
                    var e = d.text.length + 1;
                    if (e > a) {
                        c = a;
                        return true
                    }
                    a -= e;
                    ++b
                });
                return Yc({
                    line: b,
                    ch: c
                })
            },
            indexFromPos: function (a) {
                if (a.line < 0 || a.ch < 0) return 0;
                var b = a.ch;
                ub.iter(0, a.line, function (a) {
                    b += a.text.length + 1
                });
                return b
            },
            scrollTo: function (a, b) {
                if (a != null) U.scrollLeft = a;
                if (b != null) U.scrollTop = b;
                Nc([])
            },
            operation: function (a) {
                return Zd(a)()
            },
            compoundChange: function (a) {
                return $d(a)
            },
            refresh: function () {
                Nc(true);
                if (U.scrollHeight > Bb) U.scrollTop = Bb
            },
            getInputField: function () {
                return R
            },
            getWrapperElement: function () {
                return A
            },
            getScrollerElement: function () {
                return U
            },
            getGutterElement: function () {
                return cb
            }
        };
        var kc = null,
            lc;
        var Cc = false;
        var Fc = "";
        var ad = null;
        md.prototype.clear = Zd(function () {
            var a = Infinity,
                b = -Infinity;
            for (var c = 0, d = this.set.length; c < d; ++c) {
                var e = this.set[c],
                    f = e.marked;
                if (!f || !e.parent) continue;
                var g = w(e);
                a = Math.min(a, g);
                b = Math.max(b, g);
                for (var h = 0; h < f.length; ++h) if (f[h].marker == this) f.splice(h--, 1)
            }
            if (a != Infinity) Hb.push({
                from: a,
                to: b + 1
            })
        });
        md.prototype.find = function () {
            var a, b;
            for (var c = 0, d = this.set.length; c < d; ++c) {
                var e = this.set[c],
                    f = e.marked;
                for (var g = 0; g < f.length; ++g) {
                    var h = f[g];
                    if (h.marker == this) {
                        if (h.from != null || h.to != null) {
                            var i = w(e);
                            if (i != null) {
                                if (h.from != null) a = {
                                    line: i,
                                    ch: h.from
                                };
                                if (h.to != null) b = {
                                    line: i,
                                    ch: h.to
                                }
                            }
                        }
                    }
                }
            }
            return {
                from: a,
                to: b
            }
        };
        var yd = "CodeMirror-temp-" + Math.floor(Math.random() * 16777215).toString(16);
        var Dd, Ed, Fd;
        var Hd, Id = 0;
        var Pd = {
            "(": ")>",
            ")": "(<",
            "[": "]>",
            "]": "[<",
            "{": "}>",
            "}": "{<"
        };
        var Yd = 0;
        for (var _d in g) if (g.propertyIsEnumerable(_d) && !$b.propertyIsEnumerable(_d)) $b[_d] = g[_d];
        return $b
    }
    function j(a) {
        if (typeof a == "string") return i[a];
        else return a
    }
    function k(a, b, c, d, e) {
        function f(b) {
            b = j(b);
            var c = b[a];
            if (c != null && d(c)) return true;
            if (b.nofallthrough) {
                if (e) e();
                return true
            }
            var g = b.fallthrough;
            if (g == null) return false;
            if (Object.prototype.toString.call(g) != "[object Array]") return f(g);
            for (var h = 0, i = g.length; h < i; ++h) {
                if (f(g[h])) return true
            }
            return false
        }
        if (b && f(b)) return true;
        return f(c)
    }
    function l(a) {
        var b = jb[H(a, "keyCode")];
        return b == "Ctrl" || b == "Alt" || b == "Shift" || b == "Mod"
    }
    function m(a, b) {
        if (b === true) return b;
        if (a.copyState) return a.copyState(b);
        var c = {};
        for (var d in b) {
            var e = b[d];
            if (e instanceof Array) e = e.concat([]);
            c[d] = e
        }
        return c
    }
    function n(a, b, c) {
        return a.startState ? a.startState(b, c) : true
    }
    function o(a, b) {
        this.pos = this.start = 0;
        this.string = a;
        this.tabSize = b || 8
    }
    function p(a, b, c, d) {
        this.from = a;
        this.to = b;
        this.style = c;
        this.marker = d
    }
    function q(a) {
        this.from = a;
        this.to = a;
        this.line = null
    }
    function r(a, b) {
        this.styles = b || [a, null];
        this.text = a;
        this.height = 1;
        this.marked = this.gutterMarker = this.className = this.bgClassName = this.handlers = null;
        this.stateAfter = this.parent = this.hidden = null
    }
    function s(a, b, c, d) {
        for (var e = 0, f = 0, g = 0; f < b; e += 2) {
            var h = c[e],
                i = f + h.length;
            if (g == 0) {
                if (i > a) d.push(h.slice(a - f, Math.min(h.length, b - f)), c[e + 1]);
                if (i >= a) g = 1
            } else if (g == 1) {
                if (i > b) d.push(h.slice(0, b - f), c[e + 1]);
                else d.push(h, c[e + 1])
            }
            f = i
        }
    }
    function t(a) {
        this.lines = a;
        this.parent = null;
        for (var b = 0, c = a.length, d = 0; b < c; ++b) {
            a[b].parent = this;
            d += a[b].height
        }
        this.height = d
    }
    function u(a) {
        this.children = a;
        var b = 0,
            c = 0;
        for (var d = 0, e = a.length; d < e; ++d) {
            var f = a[d];
            b += f.chunkSize();
            c += f.height;
            f.parent = this
        }
        this.size = b;
        this.height = c;
        this.parent = null
    }
    function v(a, b) {
        while (!a.lines) {
            for (var c = 0;; ++c) {
                var d = a.children[c],
                    e = d.chunkSize();
                if (b < e) {
                    a = d;
                    break
                }
                b -= e
            }
        }
        return a.lines[b]
    }
    function w(a) {
        if (a.parent == null) return null;
        var b = a.parent,
            c = fb(b.lines, a);
        for (var d = b.parent; d; b = d, d = d.parent) {
            for (var e = 0, f = d.children.length;; ++e) {
                if (d.children[e] == b) break;
                c += d.children[e].chunkSize()
            }
        }
        return c
    }
    function x(a, b) {
        var c = 0;
        a: do {
            for (var d = 0, e = a.children.length; d < e; ++d) {
                var f = a.children[d],
                    g = f.height;
                if (b < g) {
                    a = f;
                    continue a
                }
                b -= g;
                c += f.chunkSize()
            }
            return c
        } while (!a.lines);
        for (var d = 0, e = a.lines.length; d < e; ++d) {
            var h = a.lines[d],
                i = h.height;
            if (b < i) break;
            b -= i
        }
        return c + d
    }
    function y(a, b) {
        var c = 0;
        a: do {
            for (var d = 0, e = a.children.length; d < e; ++d) {
                var f = a.children[d],
                    g = f.chunkSize();
                if (b < g) {
                    a = f;
                    continue a
                }
                b -= g;
                c += f.height
            }
            return c
        } while (!a.lines);
        for (var d = 0; d < b; ++d) c += a.lines[d].height;
        return c
    }
    function z() {
        this.time = 0;
        this.done = [];
        this.undone = [];
        this.compound = 0;
        this.closed = false
    }
    function A() {
        E(this)
    }
    function B(a) {
        if (!a.stop) a.stop = A;
        return a
    }
    function C(a) {
        if (a.preventDefault) a.preventDefault();
        else a.returnValue = false
    }
    function D(a) {
        if (a.stopPropagation) a.stopPropagation();
        else a.cancelBubble = true
    }
    function E(a) {
        C(a);
        D(a)
    }
    function F(a) {
        return a.target || a.srcElement
    }
    function G(a) {
        if (a.which) return a.which;
        else if (a.button & 1) return 1;
        else if (a.button & 2) return 3;
        else if (a.button & 4) return 2
    }
    function H(a, b) {
        var c = a.override && a.override.hasOwnProperty(b);
        return c ? a.override[b] : a[b]
    }
    function I(a, b, c, d) {
        if (typeof a.addEventListener == "function") {
            a.addEventListener(b, c, false);
            if (d) return function () {
                a.removeEventListener(b, c, false)
            }
        } else {
            var e = function (a) {
                c(a || window.event)
            };
            a.attachEvent("on" + b, e);
            if (d) return function () {
                a.detachEvent("on" + b, e)
            }
        }
    }
    function J() {
        this.id = null
    }
    function W(a, b, c) {
        if (b == null) {
            b = a.search(/[^\s\u00a0]/);
            if (b == -1) b = a.length
        }
        for (var d = 0, e = 0; d < b; ++d) {
            if (a.charAt(d) == "	") e += c - e % c;
            else ++e
        }
        return e
    }
    function X(a) {
        if (a.currentStyle) return a.currentStyle;
        return window.getComputedStyle(a, null)
    }
    function Y(a, b) {
        var c = a.ownerDocument.body;
        var d = 0,
            e = 0,
            f = false;
        for (var g = a; g; g = g.offsetParent) {
            var h = g.offsetLeft,
                i = g.offsetTop;
            if (g == c) {
                d += Math.abs(h);
                e += Math.abs(i)
            } else {
                d += h, e += i
            }
            if (b && X(g).position == "fixed") f = true
        }
        var j = b && !f ? null : c;
        for (var g = a.parentNode; g != j; g = g.parentNode) if (g.scrollLeft != null) {
            d -= g.scrollLeft;
            e -= g.scrollTop
        }
        return {
            left: d,
            top: e
        }
    }
    function Z(a) {
        return a.textContent || a.innerText || a.nodeValue || ""
    }
    function $(a) {
        if (b) {
            a.selectionStart = 0;
            a.selectionEnd = a.value.length
        } else a.select()
    }
    function _(a, b) {
        return a.line == b.line && a.ch == b.ch
    }
    function ab(a, b) {
        return a.line < b.line || a.line == b.line && a.ch < b.ch
    }
    function bb(a) {
        return {
            line: a.line,
            ch: a.ch
        }
    }
    function db(a) {
        cb.textContent = a;
        return cb.innerHTML
    }
    function eb(a, b) {
        if (!b) return 0;
        if (!a) return b.length;
        for (var c = a.length, d = b.length; c >= 0 && d >= 0; --c, --d) if (a.charAt(c) != b.charAt(d)) break;
        return d + 1
    }
    function fb(a, b) {
        if (a.indexOf) return a.indexOf(b);
        for (var c = 0, d = a.length; c < d; ++c) if (a[c] == b) return c;
        return -1
    }
    function gb(a) {
        return /\w/.test(a) || a.toUpperCase() != a.toLowerCase()
    }
    a.defaults = {
        value: "",
        mode: null,
        theme: "default",
        indentUnit: 2,
        indentWithTabs: false,
        smartIndent: true,
        tabSize: 4,
        keyMap: "default",
        extraKeys: null,
        electricChars: true,
        autoClearEmptyLines: false,
        onKeyEvent: null,
        onDragEvent: null,
        lineWrapping: false,
        lineNumbers: false,
        gutter: false,
        fixedGutter: false,
        firstLineNumber: 1,
        readOnly: false,
        dragDrop: true,
        onChange: null,
        onCursorActivity: null,
        onGutterClick: null,
        onHighlightComplete: null,
        onUpdate: null,
        onFocus: null,
        onBlur: null,
        onScroll: null,
        matchBrackets: false,
        workTime: 100,
        workDelay: 200,
        pollInterval: 100,
        undoDepth: 40,
        tabindex: null,
        autofocus: null
    };
    var b = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
    var c = b || /Mac/.test(navigator.platform);
    var d = /Win/.test(navigator.platform);
    var e = a.modes = {}, f = a.mimeModes = {};
    a.defineMode = function (b, c) {
        if (!a.defaults.mode && b != "null") a.defaults.mode = b;
        if (arguments.length > 2) {
            c.dependencies = [];
            for (var d = 2; d < arguments.length; ++d) c.dependencies.push(arguments[d])
        }
        e[b] = c
    };
    a.defineMIME = function (a, b) {
        f[a] = b
    };
    a.resolveMode = function (b) {
        if (typeof b == "string" && f.hasOwnProperty(b)) b = f[b];
        else if (typeof b == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(b)) return a.resolveMode("application/xml");
        if (typeof b == "string") return {
            name: b
        };
        else return b || {
            name: "null"
        }
    };
    a.getMode = function (b, c) {
        var c = a.resolveMode(c);
        var d = e[c.name];
        if (!d) return a.getMode(b, "text/plain");
        return d(b, c)
    };
    a.listModes = function () {
        var a = [];
        for (var b in e) if (e.propertyIsEnumerable(b)) a.push(b);
        return a
    };
    a.listMIMEs = function () {
        var a = [];
        for (var b in f) if (f.propertyIsEnumerable(b)) a.push({
            mime: b,
            mode: f[b]
        });
        return a
    };
    var g = a.extensions = {};
    a.defineExtension = function (a, b) {
        g[a] = b
    };
    var h = a.commands = {
        selectAll: function (a) {
            a.setSelection({
                line: 0,
                ch: 0
            }, {
                line: a.lineCount() - 1
            })
        },
        killLine: function (a) {
            var b = a.getCursor(true),
                c = a.getCursor(false),
                d = !_(b, c);
            if (!d && a.getLine(b.line).length == b.ch) a.replaceRange("", b, {
                line: b.line + 1,
                ch: 0
            });
            else a.replaceRange("", b, d ? c : {
                line: b.line
            })
        },
        deleteLine: function (a) {
            var b = a.getCursor().line;
            a.replaceRange("", {
                line: b,
                ch: 0
            }, {
                line: b
            })
        },
        undo: function (a) {
            a.undo()
        },
        redo: function (a) {
            a.redo()
        },
        goDocStart: function (a) {
            a.setCursor(0, 0, true)
        },
        goDocEnd: function (a) {
            a.setSelection({
                line: a.lineCount() - 1
            }, null, true)
        },
        goLineStart: function (a) {
            a.setCursor(a.getCursor().line, 0, true)
        },
        goLineStartSmart: function (a) {
            var b = a.getCursor();
            var c = a.getLine(b.line),
                d = Math.max(0, c.search(/\S/));
            a.setCursor(b.line, b.ch <= d && b.ch ? 0 : d, true)
        },
        goLineEnd: function (a) {
            a.setSelection({
                line: a.getCursor().line
            }, null, true)
        },
        goLineUp: function (a) {
            a.moveV(-1, "line")
        },
        goLineDown: function (a) {
            a.moveV(1, "line")
        },
        goPageUp: function (a) {
            a.moveV(-1, "page")
        },
        goPageDown: function (a) {
            a.moveV(1, "page")
        },
        goCharLeft: function (a) {
            a.moveH(-1, "char")
        },
        goCharRight: function (a) {
            a.moveH(1, "char")
        },
        goColumnLeft: function (a) {
            a.moveH(-1, "column")
        },
        goColumnRight: function (a) {
            a.moveH(1, "column")
        },
        goWordLeft: function (a) {
            a.moveH(-1, "word")
        },
        goWordRight: function (a) {
            a.moveH(1, "word")
        },
        delCharLeft: function (a) {
            a.deleteH(-1, "char")
        },
        delCharRight: function (a) {
            a.deleteH(1, "char")
        },
        delWordLeft: function (a) {
            a.deleteH(-1, "word")
        },
        delWordRight: function (a) {
            a.deleteH(1, "word")
        },
        indentAuto: function (a) {
            a.indentSelection("smart")
        },
        indentMore: function (a) {
            a.indentSelection("add")
        },
        indentLess: function (a) {
            a.indentSelection("subtract")
        },
        insertTab: function (a) {
            a.replaceSelection("	", "end")
        },
        defaultTab: function (a) {
            if (a.somethingSelected()) a.indentSelection("add");
            else a.replaceSelection("	", "end")
        },
        transposeChars: function (a) {
            var b = a.getCursor(),
                c = a.getLine(b.line);
            if (b.ch > 0 && b.ch < c.length - 1) a.replaceRange(c.charAt(b.ch) + c.charAt(b.ch - 1), {
                line: b.line,
                ch: b.ch - 1
            }, {
                line: b.line,
                ch: b.ch + 1
            })
        },
        newlineAndIndent: function (a) {
            a.replaceSelection("\n", "end");
            a.indentLine(a.getCursor().line)
        },
        toggleOverwrite: function (a) {
            a.toggleOverwrite()
        }
    };
    var i = a.keyMap = {};
    i.basic = {
        Left: "goCharLeft",
        Right: "goCharRight",
        Up: "goLineUp",
        Down: "goLineDown",
        End: "goLineEnd",
        Home: "goLineStartSmart",
        PageUp: "goPageUp",
        PageDown: "goPageDown",
        Delete: "delCharRight",
        Backspace: "delCharLeft",
        Tab: "defaultTab",
        "Shift-Tab": "indentAuto",
        Enter: "newlineAndIndent",
        Insert: "toggleOverwrite"
    };
    i.pcDefault = {
        "Ctrl-A": "selectAll",
        "Ctrl-D": "deleteLine",
        "Ctrl-Z": "undo",
        "Shift-Ctrl-Z": "redo",
        "Ctrl-Y": "redo",
        "Ctrl-Home": "goDocStart",
        "Alt-Up": "goDocStart",
        "Ctrl-End": "goDocEnd",
        "Ctrl-Down": "goDocEnd",
        "Ctrl-Left": "goWordLeft",
        "Ctrl-Right": "goWordRight",
        "Alt-Left": "goLineStart",
        "Alt-Right": "goLineEnd",
        "Ctrl-Backspace": "delWordLeft",
        "Ctrl-Delete": "delWordRight",
        "Ctrl-S": "save",
        "Ctrl-F": "find",
        "Ctrl-G": "findNext",
        "Shift-Ctrl-G": "findPrev",
        "Shift-Ctrl-F": "replace",
        "Shift-Ctrl-R": "replaceAll",
        "Ctrl-[": "indentLess",
        "Ctrl-]": "indentMore",
        fallthrough: "basic"
    };
    i.macDefault = {
        "Cmd-A": "selectAll",
        "Cmd-D": "deleteLine",
        "Cmd-Z": "undo",
        "Shift-Cmd-Z": "redo",
        "Cmd-Y": "redo",
        "Cmd-Up": "goDocStart",
        "Cmd-End": "goDocEnd",
        "Cmd-Down": "goDocEnd",
        "Alt-Left": "goWordLeft",
        "Alt-Right": "goWordRight",
        "Cmd-Left": "goLineStart",
        "Cmd-Right": "goLineEnd",
        "Alt-Backspace": "delWordLeft",
        "Ctrl-Alt-Backspace": "delWordRight",
        "Alt-Delete": "delWordRight",
        "Cmd-S": "save",
        "Cmd-F": "find",
        "Cmd-G": "findNext",
        "Shift-Cmd-G": "findPrev",
        "Cmd-Alt-F": "replace",
        "Shift-Cmd-Alt-F": "replaceAll",
        "Cmd-[": "indentLess",
        "Cmd-]": "indentMore",
        fallthrough: ["basic", "emacsy"]
    };
    i["default"] = c ? i.macDefault : i.pcDefault;
    i.emacsy = {
        "Ctrl-F": "goCharRight",
        "Ctrl-B": "goCharLeft",
        "Ctrl-P": "goLineUp",
        "Ctrl-N": "goLineDown",
        "Alt-F": "goWordRight",
        "Alt-B": "goWordLeft",
        "Ctrl-A": "goLineStart",
        "Ctrl-E": "goLineEnd",
        "Ctrl-V": "goPageUp",
        "Shift-Ctrl-V": "goPageDown",
        "Ctrl-D": "delCharRight",
        "Ctrl-H": "delCharLeft",
        "Alt-D": "delWordRight",
        "Alt-Backspace": "delWordLeft",
        "Ctrl-K": "killLine",
        "Ctrl-T": "transposeChars"
    };
    a.fromTextArea = function (b, c) {
        function d() {
            b.value = h.getValue()
        }
        if (!c) c = {};
        c.value = b.value;
        if (!c.tabindex && b.tabindex) c.tabindex = b.tabindex;
        if (c.autofocus == null && b.getAttribute("autofocus") != null) c.autofocus = true;
        if (b.form) {
            var e = I(b.form, "submit", d, true);
            if (typeof b.form.submit == "function") {
                var f = b.form.submit;

                function g() {
                    d();
                    b.form.submit = f;
                    b.form.submit();
                    b.form.submit = g
                }
                b.form.submit = g
            }
        }
        b.style.display = "none";
        var h = a(function (a) {
            b.parentNode.insertBefore(a, b.nextSibling)
        }, c);
        h.save = d;
        h.getTextArea = function () {
            return b
        };
        h.toTextArea = function () {
            d();
            b.parentNode.removeChild(h.getWrapperElement());
            b.style.display = "";
            if (b.form) {
                e();
                if (typeof b.form.submit == "function") b.form.submit = f
            }
        };
        return h
    };
    a.copyState = m;
    a.startState = n;
    o.prototype = {
        eol: function () {
            return this.pos >= this.string.length
        },
        sol: function () {
            return this.pos == 0
        },
        peek: function () {
            return this.string.charAt(this.pos)
        },
        next: function () {
            if (this.pos < this.string.length) return this.string.charAt(this.pos++)
        },
        eat: function (a) {
            var b = this.string.charAt(this.pos);
            if (typeof a == "string") var c = b == a;
            else var c = b && (a.test ? a.test(b) : a(b));
            if (c) {
                ++this.pos;
                return b
            }
        },
        eatWhile: function (a) {
            var b = this.pos;
            while (this.eat(a)) {}
            return this.pos > b
        },
        eatSpace: function () {
            var a = this.pos;
            while (/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;
            return this.pos > a
        },
        skipToEnd: function () {
            this.pos = this.string.length
        },
        skipTo: function (a) {
            var b = this.string.indexOf(a, this.pos);
            if (b > -1) {
                this.pos = b;
                return true
            }
        },
        backUp: function (a) {
            this.pos -= a
        },
        column: function () {
            return W(this.string, this.start, this.tabSize)
        },
        indentation: function () {
            return W(this.string, null, this.tabSize)
        },
        match: function (a, b, c) {
            if (typeof a == "string") {
                function d(a) {
                    return c ? a.toLowerCase() : a
                }
                if (d(this.string).indexOf(d(a), this.pos) == this.pos) {
                    if (b !== false) this.pos += a.length;
                    return true
                }
            } else {
                var e = this.string.slice(this.pos).match(a);
                if (e && b !== false) this.pos += e[0].length;
                return e
            }
        },
        current: function () {
            return this.string.slice(this.start, this.pos)
        }
    };
    a.StringStream = o;
    p.prototype = {
        attach: function (a) {
            this.marker.set.push(a)
        },
        detach: function (a) {
            var b = fb(this.marker.set, a);
            if (b > -1) this.marker.set.splice(b, 1)
        },
        split: function (a, b) {
            if (this.to <= a && this.to != null) return null;
            var c = this.from < a || this.from == null ? null : this.from - a + b;
            var d = this.to == null ? null : this.to - a + b;
            return new p(c, d, this.style, this.marker)
        },
        dup: function () {
            return new p(null, null, this.style, this.marker)
        },
        clipTo: function (a, b, c, d, e) {
            if (a && d > this.from && (d < this.to || this.to == null)) this.from = null;
            else if (this.from != null && this.from >= b) this.from = Math.max(d, this.from) + e;
            if (c && (b < this.to || this.to == null) && (b > this.from || this.from == null)) this.to = null;
            else if (this.to != null && this.to > b) this.to = d < this.to ? this.to + e : b
        },
        isDead: function () {
            return this.from != null && this.to != null && this.from >= this.to
        },
        sameSet: function (a) {
            return this.marker == a.marker
        }
    };
    q.prototype = {
        attach: function (a) {
            this.line = a
        },
        detach: function (a) {
            if (this.line == a) this.line = null
        },
        split: function (a, b) {
            if (a < this.from) {
                this.from = this.to = this.from - a + b;
                return this
            }
        },
        isDead: function () {
            return this.from > this.to
        },
        clipTo: function (a, b, c, d, e) {
            if ((a || b < this.from) && (c || d > this.to)) {
                this.from = 0;
                this.to = -1
            } else if (this.from > b) {
                this.from = this.to = Math.max(d, this.from) + e
            }
        },
        sameSet: function (a) {
            return false
        },
        find: function () {
            if (!this.line || !this.line.parent) return null;
            return {
                line: w(this.line),
                ch: this.from
            }
        },
        clear: function () {
            if (this.line) {
                var a = fb(this.line.marked, this);
                if (a != -1) this.line.marked.splice(a, 1);
                this.line = null
            }
        }
    };
    r.inheritMarks = function (a, b) {
        var c = new r(a),
            d = b && b.marked;
        if (d) {
            for (var e = 0; e < d.length; ++e) {
                if (d[e].to == null && d[e].style) {
                    var f = c.marked || (c.marked = []),
                        g = d[e];
                    var h = g.dup();
                    f.push(h);
                    h.attach(c)
                }
            }
        }
        return c
    };
    r.prototype = {
        replace: function (a, b, c) {
            var d = [],
                e = this.marked,
                f = b == null ? this.text.length : b;
            s(0, a, this.styles, d);
            if (c) d.push(c, null);
            s(f, this.text.length, this.styles, d);
            this.styles = d;
            this.text = this.text.slice(0, a) + c + this.text.slice(f);
            this.stateAfter = null;
            if (e) {
                var g = c.length - (f - a);
                for (var h = 0; h < e.length; ++h) {
                    var i = e[h];
                    i.clipTo(a == null, a || 0, b == null, f, g);
                    if (i.isDead()) {
                        i.detach(this);
                        e.splice(h--, 1)
                    }
                }
            }
        },
        split: function (a, b) {
            var c = [b, null],
                d = this.marked;
            s(a, this.text.length, this.styles, c);
            var e = new r(b + this.text.slice(a), c);
            if (d) {
                for (var f = 0; f < d.length; ++f) {
                    var g = d[f];
                    var h = g.split(a, b.length);
                    if (h) {
                        if (!e.marked) e.marked = [];
                        e.marked.push(h);
                        h.attach(e);
                        if (h == g) d.splice(f--, 1)
                    }
                }
            }
            return e
        },
        append: function (a) {
            var b = this.text.length,
                c = a.marked,
                d = this.marked;
            this.text += a.text;
            s(0, a.text.length, a.styles, this.styles);
            if (d) {
                for (var e = 0; e < d.length; ++e) if (d[e].to == null) d[e].to = b
            }
            if (c && c.length) {
                if (!d) this.marked = d = [];
                a: for (var e = 0; e < c.length; ++e) {
                    var f = c[e];
                    if (!f.from) {
                        for (var g = 0; g < d.length; ++g) {
                            var h = d[g];
                            if (h.to == b && h.sameSet(f)) {
                                h.to = f.to == null ? null : f.to + b;
                                if (h.isDead()) {
                                    h.detach(this);
                                    c.splice(e--, 1)
                                }
                                continue a
                            }
                        }
                    }
                    d.push(f);
                    f.attach(this);
                    f.from += b;
                    if (f.to != null) f.to += b
                }
            }
        },
        fixMarkEnds: function (a) {
            var b = this.marked,
                c = a.marked;
            if (!b) return;
            for (var d = 0; d < b.length; ++d) {
                var e = b[d],
                    f = e.to == null;
                if (f && c) {
                    for (var g = 0; g < c.length; ++g) if (c[g].sameSet(e)) {
                        f = false;
                        break
                    }
                }
                if (f) e.to = this.text.length
            }
        },
        fixMarkStarts: function () {
            var a = this.marked;
            if (!a) return;
            for (var b = 0; b < a.length; ++b) if (a[b].from == null) a[b].from = 0
        },
        addMark: function (a) {
            a.attach(this);
            if (this.marked == null) this.marked = [];
            this.marked.push(a);
            this.marked.sort(function (a, b) {
                return (a.from || 0) - (b.from || 0)
            })
        },
        highlight: function (a, b, c) {
            var d = new o(this.text, c),
                e = this.styles,
                f = 0;
            var g = false,
                h = e[0],
                i;
            if (this.text == "" && a.blankLine) a.blankLine(b);
            while (!d.eol()) {
                var j = a.token(d, b);
                var k = this.text.slice(d.start, d.pos);
                d.start = d.pos;
                if (f && e[f - 1] == j) e[f - 2] += k;
                else if (k) {
                    if (!g && (e[f + 1] != j || f && e[f - 2] != i)) g = true;
                    e[f++] = k;
                    e[f++] = j;
                    i = h;
                    h = e[f]
                }
                if (d.pos > 5e3) {
                    e[f++] = this.text.slice(d.pos);
                    e[f++] = null;
                    break
                }
            }
            if (e.length != f) {
                e.length = f;
                g = true
            }
            if (f && e[f - 2] != i) g = true;
            return g || (e.length < 5 && this.text.length < 10 ? null : false)
        },
        getTokenAt: function (a, b, c) {
            var d = this.text,
                e = new o(d);
            while (e.pos < c && !e.eol()) {
                e.start = e.pos;
                var f = a.token(e, b)
            }
            return {
                start: e.start,
                end: e.pos,
                string: e.current(),
                className: f || null,
                state: b
            }
        },
        indentation: function (a) {
            return W(this.text, null, a)
        },
        getHTML: function (a, b, c, d) {
            function h(b, c) {
                if (!b) return;
                if (f && M && b.charAt(0) == " ") b = " " + b.slice(1);
                f = false;
                if (b.indexOf("	") == -1) {
                    g += b.length;
                    var d = db(b)
                } else {
                    var d = "";
                    for (var h = 0;;) {
                        var i = b.indexOf("	", h);
                        if (i == -1) {
                            d += db(b.slice(h));
                            g += b.length - h;
                            break
                        } else {
                            g += i - h;
                            var j = a(g);
                            d += db(b.slice(h, i)) + j.html;
                            g += j.width;
                            h = i + 1
                        }
                    }
                }
                if (c) e.push('<span class="', c, '">', d, "</span>");
                else e.push(d)
            }
            function p(a) {
                if (!a) return null;
                return "cm-" + a.replace(/ +/g, " cm-")
            }
            var e = [],
                f = true,
                g = 0;
            var i = h;
            if (b != null) {
                var j = 0,
                    k = '<span id="' + c + '">';
                i = function (a, c) {
                    var f = a.length;
                    if (b >= j && b < j + f) {
                        if (b > j) {
                            h(a.slice(0, b - j), c);
                            if (d) e.push("<wbr>")
                        }
                        e.push(k);
                        var g = b - j;
                        h(window.opera ? a.slice(g, g + 1) : a.slice(g), c);
                        e.push("</span>");
                        if (window.opera) h(a.slice(g + 1), c);
                        b--;
                        j += f
                    } else {
                        j += f;
                        h(a, c);
                        if (j == b && j == o) e.push(k + " </span>");
                        else if (j > b + 10 && /\s/.test(a)) i = function () {}
                    }
                }
            }
            var l = this.styles,
                m = this.text,
                n = this.marked;
            var o = m.length;
            if (!m && b == null) {
                i(" ")
            } else if (!n || !n.length) {
                for (var q = 0, r = 0; r < o; q += 2) {
                    var s = l[q],
                        t = l[q + 1],
                        u = s.length;
                    if (r + u > o) s = s.slice(0, o - r);
                    r += u;
                    i(s, p(t))
                }
            } else {
                var v = 0,
                    q = 0,
                    w = "",
                    t, x = 0;
                var y = n[0].from || 0,
                    z = [],
                    A = 0;

                function B() {
                    var a;
                    while (A < n.length && ((a = n[A]).from == v || a.from == null)) {
                        if (a.style != null) z.push(a);
                        ++A
                    }
                    y = A < n.length ? n[A].from : Infinity;
                    for (var b = 0; b < z.length; ++b) {
                        var c = z[b].to || Infinity;
                        if (c == v) z.splice(b--, 1);
                        else y = Math.min(c, y)
                    }
                }
                var C = 0;
                while (v < o) {
                    if (y == v) B();
                    var D = Math.min(o, y);
                    while (true) {
                        if (w) {
                            var E = v + w.length;
                            var F = t;
                            for (var G = 0; G < z.length; ++G) F = (F ? F + " " : "") + z[G].style;
                            i(E > D ? w.slice(0, D - v) : w, F);
                            if (E >= D) {
                                w = w.slice(D - v);
                                v = D;
                                break
                            }
                            v = E
                        }
                        w = l[q++];
                        t = p(l[q++])
                    }
                }
            }
            return e.join("")
        },
        cleanUp: function () {
            this.parent = null;
            if (this.marked) for (var a = 0, b = this.marked.length; a < b; ++a) this.marked[a].detach(this)
        }
    };
    t.prototype = {
        chunkSize: function () {
            return this.lines.length
        },
        remove: function (a, b, c) {
            for (var d = a, e = a + b; d < e; ++d) {
                var f = this.lines[d];
                this.height -= f.height;
                f.cleanUp();
                if (f.handlers) for (var g = 0; g < f.handlers.length; ++g) c.push(f.handlers[g])
            }
            this.lines.splice(a, b)
        },
        collapse: function (a) {
            a.splice.apply(a, [a.length, 0].concat(this.lines))
        },
        insertHeight: function (a, b, c) {
            this.height += c;
            if (M || b.length > 200) this.lines = this.lines.slice(0, a).concat(b).concat(this.lines.slice(a));
            else this.lines.splice.apply(this.lines, [a, 0].concat(b));
            for (var d = 0, e = b.length; d < e; ++d) b[d].parent = this
        },
        iterN: function (a, b, c) {
            for (var d = a + b; a < d; ++a) if (c(this.lines[a])) return true
        }
    };
    u.prototype = {
        chunkSize: function () {
            return this.size
        },
        remove: function (a, b, c) {
            this.size -= b;
            for (var d = 0; d < this.children.length; ++d) {
                var e = this.children[d],
                    f = e.chunkSize();
                if (a < f) {
                    var g = Math.min(b, f - a),
                        h = e.height;
                    e.remove(a, g, c);
                    this.height -= h - e.height;
                    if (f == g) {
                        this.children.splice(d--, 1);
                        e.parent = null
                    }
                    if ((b -= g) == 0) break;
                    a = 0
                } else a -= f
            }
            if (this.size - b < 25) {
                var i = [];
                this.collapse(i);
                this.children = [new t(i)];
                this.children[0].parent = this
            }
        },
        collapse: function (a) {
            for (var b = 0, c = this.children.length; b < c; ++b) this.children[b].collapse(a)
        },
        insert: function (a, b) {
            var c = 0;
            for (var d = 0, e = b.length; d < e; ++d) c += b[d].height;
            this.insertHeight(a, b, c)
        },
        insertHeight: function (a, b, c) {
            this.size += b.length;
            this.height += c;
            for (var d = 0, e = this.children.length; d < e; ++d) {
                var f = this.children[d],
                    g = f.chunkSize();
                if (a <= g) {
                    f.insertHeight(a, b, c);
                    if (f.lines && f.lines.length > 50) {
                        while (f.lines.length > 50) {
                            var h = f.lines.splice(f.lines.length - 25, 25);
                            var i = new t(h);
                            f.height -= i.height;
                            this.children.splice(d + 1, 0, i);
                            i.parent = this
                        }
                        this.maybeSpill()
                    }
                    break
                }
                a -= g
            }
        },
        maybeSpill: function () {
            if (this.children.length <= 10) return;
            var a = this;
            do {
                var b = a.children.splice(a.children.length - 5, 5);
                var c = new u(b);
                if (!a.parent) {
                    var d = new u(a.children);
                    d.parent = a;
                    a.children = [d, c];
                    a = d
                } else {
                    a.size -= c.size;
                    a.height -= c.height;
                    var e = fb(a.parent.children, a);
                    a.parent.children.splice(e + 1, 0, c)
                }
                c.parent = a.parent
            } while (a.children.length > 10);
            a.parent.maybeSpill()
        },
        iter: function (a, b, c) {
            this.iterN(a, b - a, c)
        },
        iterN: function (a, b, c) {
            for (var d = 0, e = this.children.length; d < e; ++d) {
                var f = this.children[d],
                    g = f.chunkSize();
                if (a < g) {
                    var h = Math.min(b, g - a);
                    if (f.iterN(a, h, c)) return true;
                    if ((b -= h) == 0) break;
                    a = 0
                } else a -= g
            }
        }
    };
    z.prototype = {
        addChange: function (a, b, c) {
            this.undone.length = 0;
            var d = +(new Date),
                e = this.done[this.done.length - 1],
                f = e && e[e.length - 1];
            var g = d - this.time;
            if (this.compound && e && !this.closed) {
                e.push({
                    start: a,
                    added: b,
                    old: c
                })
            } else if (g > 400 || !f || this.closed || f.start > a + c.length || f.start + f.added < a) {
                this.done.push([{
                    start: a,
                    added: b,
                    old: c
                }]);
                this.closed = false
            } else {
                var h = Math.max(0, f.start - a),
                    i = Math.max(0, a + c.length - (f.start + f.added));
                for (var j = h; j > 0; --j) f.old.unshift(c[j - 1]);
                for (var j = i; j > 0; --j) f.old.push(c[c.length - j]);
                if (h) f.start = a;
                f.added += b - (c.length - h - i)
            }
            this.time = d
        },
        startCompound: function () {
            if (!(this.compound++)) this.closed = true
        },
        endCompound: function () {
            if (!--this.compound) this.closed = true
        }
    };
    a.e_stop = E;
    a.e_preventDefault = C;
    a.e_stopPropagation = D;
    a.connect = I;
    J.prototype = {
        set: function (a, b) {
            clearTimeout(this.id);
            this.id = setTimeout(b, a)
        }
    };
    var K = a.Pass = {
        toString: function () {
            return "CodeMirror.Pass"
        }
    };
    var L = /gecko\/\d{7}/i.test(navigator.userAgent);
    var M = /MSIE \d/.test(navigator.userAgent);
    var N = /MSIE [1-8]\b/.test(navigator.userAgent);
    var O = M && document.documentMode == 5;
    var P = /WebKit\//.test(navigator.userAgent);
    var Q = /Chrome\//.test(navigator.userAgent);
    var R = /Apple Computer/.test(navigator.vendor);
    var S = /KHTML\//.test(navigator.userAgent);
    var T = function () {
        if (N) return false;
        var a = document.createElement("div");
        return "draggable" in a || "dragDrop" in a
    }();
    var U = function () {
        var a = document.createElement("textarea");
        a.value = "foo\nbar";
        if (a.value.indexOf("\r") > -1) return "\r\n";
        return "\n"
    }();
    var V = /^$/;
    if (L) V = /$'/;
    else if (R) V = /\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/;
    else if (Q) V = /\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/;
    if (document.documentElement.getBoundingClientRect != null) Y = function (a, b) {
        try {
            var c = a.getBoundingClientRect();
            c = {
                top: c.top,
                left: c.left
            }
        } catch (d) {
            c = {
                top: 0,
                left: 0
            }
        }
        if (!b) {
            if (window.pageYOffset == null) {
                var e = document.documentElement || document.body.parentNode;
                if (e.scrollTop == null) e = document.body;
                c.top += e.scrollTop;
                c.left += e.scrollLeft
            } else {
                c.top += window.pageYOffset;
                c.left += window.pageXOffset
            }
        }
        return c
    };
    var cb = document.createElement("pre");
    if (db("a") == "\na") db = function (a) {
        cb.textContent = a;
        return cb.innerHTML.slice(1)
    };
    else if (db("	") != "	") db = function (a) {
        cb.innerHTML = "";
        cb.appendChild(document.createTextNode(a));
        return cb.innerHTML
    };
    a.htmlEscape = db;
    var hb = "\n\nb".split(/\n/).length != 3 ? function (a) {
            var b = 0,
                c, d = [];
            while ((c = a.indexOf("\n", b)) > -1) {
                d.push(a.slice(b, a.charAt(c - 1) == "\r" ? c - 1 : c));
                b = c + 1
            }
            d.push(a.slice(b));
            return d
        } : function (a) {
            return a.split(/\r?\n/)
        };
    a.splitLines = hb;
    var ib = window.getSelection ? function (a) {
            try {
                return a.selectionStart != a.selectionEnd
            } catch (b) {
                return false
            }
        } : function (a) {
            try {
                var b = a.ownerDocument.selection.createRange()
            } catch (c) {}
            if (!b || b.parentElement() != a) return false;
            return b.compareEndPoints("StartToEnd", b) != 0
        };
    a.defineMode("null", function () {
        return {
            token: function (a) {
                a.skipToEnd()
            }
        }
    });
    a.defineMIME("text/plain", "null");
    var jb = {
        3: "Enter",
        8: "Backspace",
        9: "Tab",
        13: "Enter",
        16: "Shift",
        17: "Ctrl",
        18: "Alt",
        19: "Pause",
        20: "CapsLock",
        27: "Esc",
        32: "Space",
        33: "PageUp",
        34: "PageDown",
        35: "End",
        36: "Home",
        37: "Left",
        38: "Up",
        39: "Right",
        40: "Down",
        44: "PrintScrn",
        45: "Insert",
        46: "Delete",
        59: ";",
        91: "Mod",
        92: "Mod",
        93: "Mod",
        127: "Delete",
        186: ";",
        187: "=",
        188: ",",
        189: "-",
        190: ".",
        191: "/",
        192: "`",
        219: "[",
        220: "\\",
        221: "]",
        222: "'",
        63276: "PageUp",
        63277: "PageDown",
        63275: "End",
        63273: "Home",
        63234: "Left",
        63232: "Up",
        63235: "Right",
        63233: "Down",
        63302: "Insert",
        63272: "Delete"
    };
    a.keyNames = jb;
    (function () {
        for (var a = 0; a < 10; a++) jb[a + 48] = String(a);
        for (var a = 65; a <= 90; a++) jb[a] = String.fromCharCode(a);
        for (var a = 1; a <= 12; a++) jb[a + 111] = jb[a + 63235] = "F" + a
    })();
    return a
}()